<?php 
namespace Home\Model;
use Think\Model;
class UserModel extends Model{

   protected $_validate = array(
     array('nickname','require','昵称必须！',1),
     array('nickname', '2,6', '昵称长度需要是6-8位', 1, 'length'),
     array('nickname','','昵称已存在',1,'unique',1),
     array('email','email','邮箱格式不正确！',1), 
     array('email','require','邮箱必须！',1), 
     array('email','','邮箱已存在',1,'unique',1),
     array('repassword','password','两次密码不一致',1,'confirm',1),
     array('sex',array("男","女"),'密码必须是男女',1,'in',2)
   );

   public function getHotTen()
   {

        $hotusers = M('user')->field('nickname,face,answer_num')->order("answer_num desc")->limit(12)->select();

        // $sql = "select title,qid,answer_num from question where ctime>'{$time}' order by answer_num desc limit 10";
        return $hotusers;
   }
}

















 ?>